package org.university.entity;

import io.swagger.annotations.ApiModelProperty;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @TableName department
 */
@Entity
@Table(name = "department")
@Data
public class Department implements Serializable {

    @Id
    @NotNull(message = "[]不能为空")
    @ApiModelProperty("")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer deptId;
    /**
     * 院系名
     */
    @NotBlank(message = "[院系名]不能为空")
    @Size(max = 20, message = "编码长度不能超过20")
    @ApiModelProperty("院系名")
    @Length(max = 20, message = "编码长度不能超过20")
    private String deptName;
    /**
     * 地址
     */
    @Size(max = 100, message = "编码长度不能超过100")
    @ApiModelProperty("地址")
    @Length(max = 100, message = "编码长度不能超过100")
    private String deptLocation;
    /**
     * 学院电话
     */
    @Size(max = 15, message = "编码长度不能超过15")
    @ApiModelProperty("学院电话")
    @Length(max = 15, message = "编码长度不能超过15")
    private String deptPhone;
    /**
     * 院系主任名字
     */
    @Size(max = 20, message = "编码长度不能超过20")
    @ApiModelProperty("院系主任名字")
    @Length(max = 20, message = "编码长度不能超过20")
    private String deanName;

    @Column(name = "deleted", columnDefinition = "tinyint(1) default 0")
    @ApiModelProperty("是否已删除")
    private Integer deleted = 0;
}
